package com.lmx.repoDomain.tmodel;

import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;
import com.lmx.repoDomain.tmodel.business.User;//huibati;
import javax.persistence.*;

/**
 * 任务邀请表
 */
@Entity
@Table(name = "ccd_task_invitiation")
@JsonApiResource(type = "taskInvitation")
@Inheritance(strategy = InheritanceType.JOINED)
public class TaskInvitation extends BaseEntity {
	private String code;//编码
    private User inviter;//邀请人
    private User customerService;//对应客服
    private Task task;//对应任务
    private Dicttype status;//任务邀请状态  对应字典：taskInvitationStatus
    private Integer createTime;//创建时间
    private Integer updateTime;//更新时间
    private String remark;//备注

    @Column(name = "code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @JsonApiToOne
    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
    @JoinColumn(name = "inviter_id",foreignKey = @ForeignKey(name = "null"))
    public User getInviter() {
        return inviter;
    }

    public void setInviter(User inviter) {
        this.inviter = inviter;
    }

    @JsonApiToOne
    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
    @JoinColumn(name = "cs_id",foreignKey = @ForeignKey(name = "null"))
    public User getCustomerService() {
        return customerService;
    }

    public void setCustomerService(User customerService) {
        this.customerService = customerService;
    }

    @JsonApiToOne
    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
    @JoinColumn(name = "task_id",foreignKey = @ForeignKey(name = "null"))
    public Task getTask() {
        return task;
    }

    public void setTask(Task task) {
        this.task = task;
    }

    @JsonApiToOne
    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
    @JoinColumn(name = "status_id",foreignKey = @ForeignKey(name = "null"))
    public Dicttype getStatus() {
        return status;
    }

    public void setStatus(Dicttype status) {
        this.status = status;
    }

    @Column(name = "create_time")
    public Integer getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Integer createTime) {
        this.createTime = createTime;
    }

    @Column(name = "update_time")
    public Integer getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Integer updateTime) {
        this.updateTime = updateTime;
    }

    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}